package com.wlyuan.index.infrastructure.jobhandler;


import com.wlyuan.index.domain.index.service.WaybillIndexDiffService;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.CompletableFuture;

/**
 * @author yuanjie
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class WaybillIndexDiffJobHandler extends IJobHandler {
    private final WaybillIndexDiffService diffService;

    @Override
    @XxlJob("WaybillIndexDiffJob")
    public void execute() {
        CompletableFuture.runAsync(diffService::diffAll);
    }
}
